package com.yanboo.modules.mnt.domain;

import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.bean.copier.CopyOptions;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Getter;
import lombok.Setter;
import com.yanboo.common.base.BaseEntity;
import jakarta.persistence.*;
import java.io.Serializable;

@Entity
@Getter
@Setter
@Table(name="mnt_database")
public class Database extends BaseEntity implements Serializable {

	@Schema(description = "数据库名称")
    private String name;

	@Schema(description = "数据库连接地址")
    private String jdbcUrl;

	@Schema(description = "数据库密码")
    private String pwd;

	@Schema(description = "用户名")
    private String userName;

    public void copy(Database source){
        BeanUtil.copyProperties(source,this, CopyOptions.create().setIgnoreNullValue(true));
    }
}
